<!-- 会员专区 -->
<template>
	<view class="container">
		<HeaderBar :currentName="_t18(`members_only`)" />
		<view class="funList" v-if="listArray.length > 0 && !isShow">
			<ItemFund v-for="item in listArray" :key="item.id" :itemObj="item"></ItemFund>
		</view>
		<Nodata v-if="listArray.length === 0 && isShow" class="funList"></Nodata>
	</view>
</template>
<script setup>
	import HeaderBar from '@/components/HeaderBar/index.vue'
	import ItemFund from './components/itemFund.vue'
	import {
		onMounted,
		ref
	} from 'vue'
	import {
		getFinancial
	} from '@/api/financial/index'
	import {
		_t18
	} from '@/utils/public'
	const listArray = ref([])
	const isShow = ref(false)
	const getInit = async () => {
		try {
			let data = {
				classify: '1'
			}
			const res = await getFinancial(data)
			if (res.code === 200) {
				listArray.value = res.rows
				listArray.value.length === 0 ? (isShow.value = true) : (isShow.value = false)
			}
		} catch (error) {}
	}
	onMounted(() => {
		getInit()
	})
</script>
<style lang="scss" scoped>
	.funList {
		display: block;
		margin-top: 60px !important;
		padding: 20px 15px 0px;
	}
</style>